package it.stasbranger.myproject.web.rest;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import org.springframework.context.ApplicationContext;

import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

import org.springframework.test.context.ContextConfiguration;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.SessionScope;

/**
 * Unit test for the <code>SuppliersHasRequestsRestController</code> controller.
 *
 * @see it.stasbranger.myproject.web.rest.SuppliersHasRequestsRestController
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
		"file:./resources/MyProject-security-context.xml",
		"file:./resources/MyProject-service-context.xml",
		"file:./resources/MyProject-dao-context.xml",
		"file:./resources/MyProject-web-context.xml" })
public class SuppliersHasRequestsRestControllerTest {
	/**
	 * The Spring application context.
	 *
	 */
	private ApplicationContext context;

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestssuppliers()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestssuppliers() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}/suppliers");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestssuppliers()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestssuppliers() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}/suppliers");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestssuppliers()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestssuppliers() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}/suppliers");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestssupplierssuppliers_idsuppliers()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestssupplierssuppliers_idsuppliers() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}/suppliers/{suppliers_idsuppliers}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestssupplierssuppliers_idsuppliers()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestssupplierssuppliers_idsuppliers() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}/suppliers/{suppliers_idsuppliers}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestsrequests()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestsrequests() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}/requests");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestsrequests()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestsrequests() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}/requests");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestsrequests()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestsrequests() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}/requests");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestsrequestsrequests_idrequests()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestsrequestsrequests_idrequests() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}/requests/{requests_idrequests}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestsrequestsrequests_idrequests()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequestsrequestsrequests_idrequests() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}/requests/{requests_idrequests}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequests()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetSuppliersHasRequests() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequests()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequests() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequests()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutSuppliersHasRequests() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequests()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostSuppliersHasRequests() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>SuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequests()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteSuppliersHasRequestssuppliershasrequests_suppliersIdsupplierssuppliershasrequests_requestsIdrequests() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/SuppliersHasRequests/{suppliershasrequests_suppliersIdsuppliers}/{suppliershasrequests_requestsIdrequests}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		SuppliersHasRequestsRestController controller = (SuppliersHasRequestsRestController) context.getBean("SuppliersHasRequestsRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Autowired to set the Spring application context.
	 *
	 */
	@Autowired
	public void setContext(ApplicationContext context) {
		this.context = context;
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("session", new SessionScope());
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("request", new RequestScope());
	}

	/**
	 * Returns a mock HttpServletRequest object.
	 *
	 */
	private MockHttpServletRequest getMockHttpServletRequest() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		ServletRequestAttributes attributes = new ServletRequestAttributes(request);
		RequestContextHolder.setRequestAttributes(attributes);
		return request;
	}

	/**
	 * Returns a mock HttpServletResponse object.
	 *
	 */
	private MockHttpServletResponse getMockHttpServletResponse() {
		return new MockHttpServletResponse();
	}
}